In many microcontrollers, for example microcontrollers manufactured by the assignee of the present disclosure, a numerical controlled oscillator (NCO) module is available. According to various embodiments, such a numerical controlled oscillator module (NCO) peripheral can be used to provide a linear frequency signal control. To this end, the NCO can be used with a technique called Direct Digital Synthesis to generate a frequency which is, on average, very finely adjustable by adding a precisely controlled sum to the generated output.
FIG. 1 shows such a generic numerical oscillator 20 in a peripheral circuit 10 of, for example a microcontroller. The numerical controlled oscillator 20 receives a reference clock r(x) and a numerical value q which may be stored in a configuration register 40, for example a special function register associated with the NCO. The numeric value q entered into the module performs an operation on the reference clock to provide an output frequency f(q). Therefore f(q)=r(x)*A; A is the numeric oscillator transfer function. The transfer function can be as simple as an addition. However other functions can be implemented such as a subtracting, multiplicative, dividing, logarithmic or any other mathematical function. In the following embodiments discussed in this application, a simple adder is used to form a numerical controlled oscillator. However, a numerical controlled oscillator as defined above may have other functions to provide for a numerical controlled clock signal as stated above. Such a numerical oscillator peripheral 10 may provide a fine tunable output frequency which can be used in particular to generate pulse width modulation output in addition to a linear frequency control.